package Practice;

import java.util.Scanner;

public class One {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        Manager manager = new Manager(a);
        System.out.println((int) manager.getSalary());
        int b = sc.nextInt();
        int c = sc.nextInt();
        Salesman salesman = new Salesman(b, c);
        System.out.println((int) salesman.getSalary());
        int d = sc.nextInt();
        int e = sc.nextInt();
        Worker worker = new Worker(d,e);
        System.out.println((int) worker.getSalary());
        sc.close();


    }
}
    class Employ{
        int Salary;
        public double getSalary(){
            return 0;
        }
    }
    class Manager extends Employ{
        int salary;
        public Manager(int salary){
            this.salary=salary;
        }

        @Override
        public double getSalary() {
            return salary;
        }
    }
    class Salesman extends Employ {
        int basesalary;
        int extrasalary;

        public Salesman(int basesalary, int extrasalary) {
            this.basesalary = basesalary;
            this.extrasalary = extrasalary;
        }

        @Override
        public double getSalary() {
            return basesalary + extrasalary;
        }
    }
    class Worker extends Employ{
        int days;
        int dayssalary;
        public Worker(int days,int dayssalary){
            this.days=days;
            this.dayssalary=dayssalary;
        }
        @Override
        public double getSalary() {
            return days * dayssalary;
        }
    }




/*import java.util.Scanner;

public class One {
    public static void main(String [] args) {
        Scanner arr=new Scanner(System.in);
        double a=arr.nextDouble();//经理工资
        Manager manager = new Manager(a);
        System.out.println((int)manager.getSalary());
        double b=arr.nextDouble();//销售工资
        double c=arr.nextDouble();//销售提成
        Salesman salesman = new Salesman(b,c);
        System.out.println((int)salesman.getSalary());
        int d = arr.nextInt();//工人工作天数
        double e = arr.nextDouble();//工人每天工资
        Worker worker = new Worker(d,e);
        System.out.println((int)worker.getSalary());
        arr.close();
    }
}
//经理
class Employee {
    double Salary;
    public double getSalary() {
        return 0;
    };
}

class Manager extends Employee{
    double Salary;
    public Manager(double Salary){
        this.Salary=Salary;
    }
    @Override

    public double getSalary(){
        return Salary;
    }
}
//销售人员

class Salesman extends Employee {
    double baseSalary;
    double extraSalary;
    public Salesman(double baseSalary,double extraSalary){
        this.baseSalary=baseSalary;
        this.extraSalary=extraSalary;
    }
    @Override
    public double getSalary(){
        return baseSalary+extraSalary;
    }
}
class Worker extends Employee{
    int days;
    double pay;
    public Worker(int days,double pay){
        this.days=days;
        this.pay=pay;
    }
    @Override
    public double getSalary(){
        return days*pay;
    }

}

 */



